<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			*{
				margin:0;
				padding:0;
			}
			.subject{
				position:fixed;
				right:100px;
				height:100px;
			}
			.subject div{
				width:100px;
				text-align: center;
			}
			.subject div a{
				text-decoration: none;
				color:black;
			}
			
			.contents{
				width:100%;
				height:2000px;
				background:cornsilk;
			}
			.contents span{
				width:30px;
				height:100px;
				text-align: center;
				background:sandybrown;
				display:inline-block;
				position:fixed;
				bottom:100px;
				right:0px;
				color:#fff;
			}
		</style>
	</head>
	<body>
		<div class="subject">
			<div><a href="index.html">图片收起展开</a></div>
			<div><a href="task2.html">回到顶部</a></div>
			<div><a href="task3.html">选项卡</a></div>
		</div>
		<div class="contents">
			<span class="back">回到顶部</span>
		</div>
		<script>
			var back=document.getElementsByClassName("back")[0];
			back.addEventListener("click",function(){
				window.scrollTo(0,0);
			})
		</script>
	</body>
</html>
